import java.util.ArrayList;
import java.util.List;

/**
 * @author <a href="mailto:sjj@jianzhimao.com">mojo</a>
 * copyright (C), 2013-2022, 广州九尾信息科技有限公司
 * @date 2022/2/12 13:50
 */
public class GenericDemo2 {
    static class A {
    }

    interface B {
        void m1();
    }

    interface C {
        void m2();
    }

    static class Demo1<T extends A & B & C> {
        void m(T t) {

        }
    }

    static class DemoImpl1 extends A implements B, C {

        @Override
        public void m1() {
            System.out.println(">>>");
        }

        @Override
        public void m2() {

        }
    }

    public static void main(String[] args) {
        //DemoImpl1需同时集成A，实现B和C
        Demo1<DemoImpl1>[] demo1 = new Demo1[1];
        demo1[0] = new Demo1<>();
    }

}

class Box<T> {
    final T x;

    Box(T x) {
        this.x = x;
    }
}

class Loophole {
    public static void main(String[] args) {
        Box<String>[] bsa = new Box[3];
        Object[] oa = bsa;
        // error not caught by array store check
        bsa[0] = new Box<>("s");
        // BOOM!，运行时报类型转换错误
        String s = bsa[0].x;
        List<String> list = new ArrayList();
    }
}